#include "rclcpp/rclcpp.hpp"
#include "zdym/msg/tms.hpp"
#include<string>
using std::placeholders::_1;
class sub:public rclcpp::Node{
    public :
    sub():Node("sub")
    {
        suber_=this->create_subscription<zdym::msg::Tms>("time",10,std::bind(&sub::topic_callback,this,_1));
    }
    private:
    void topic_callback(const zdym::msg::Tms &msg)const{
        RCLCPP_INFO(this->get_logger(),"%d年%d月%d日%d：%d：%d：",msg.year,msg.mongth,msg.day,msg.hour,msg.minute,msg.second);
    }
    rclcpp::Subscription<zdym::msg::Tms>::SharedPtr suber_;
};
int main(int argc,char *argv[]){
    rclcpp::init(argc,argv);
    rclcpp::spin(std::make_shared<sub>());
    rclcpp::shutdown();
    return 0;
}